package com.x.service.entity.map;

import com.x.service.entity.RangeList;
import com.x.zssqservice.bean.RankingList;

import java.util.ArrayList;

/**
 * Created by H on 18/5/9.
 */

public class RankingListToRangeList implements IMap<RankingList, RangeList> {
    @Override
    public RangeList map(RankingList rankingList) {
        RangeList rangeList = new RangeList();
        rangeList.ok = rankingList.ok;
        rangeList.ranges = new ArrayList<>();
        for (RankingList.MaleBean range : rankingList.male) {
            RangeList.Range xRange = new RangeList.Range();
            xRange._id = range._id;
            xRange.cover = IMG_BASE_URL + range.cover;
            xRange.title = range.title;
            rangeList.ranges.add(xRange);
        }

        for (RankingList.MaleBean range : rankingList.female) {
            RangeList.Range xRange = new RangeList.Range();
            xRange._id = range._id;
            xRange.cover = IMG_BASE_URL + range.cover;
            xRange.title = range.title;
            rangeList.ranges.add(xRange);
        }
        return rangeList;
    }
}
